Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.2K
Visualizações
TimeTrigger Exception "Could not create BlobContainerClient for ScheduleMonitor."

When I run my azure function with TimeTrigger I have this error: Microsoft.Azure.WebJobs.Extensions.Timers.Storage: Could not create BlobContainerClient for ScheduleMonitor.

I use a host builder:

public static async Task Main()
        {
            var host = CreateHostBuilder().Build();

            using (host)
            {
                await host.RunAsync();
            }

        static IHostBuilder CreateHostBuilder() => new HostBuilder()
            .UseServiceProviderFactory(new AutofacServiceProviderFactory())
            .ConfigureFunctionsWorkerDefaults()
            .ConfigureHostConfiguration(configHost =>
            {
                configHost.SetBasePath(Directory.GetCurrentDirectory());
                configHost.AddJsonFile("host.json", optional: true);
                configHost.AddEnvironmentVariables();
            })
            .ConfigureAppConfiguration((hostContext, configApp) =>
            {
                var env = hostContext.HostingEnvironment;
                configApp.AddJsonFile("appsettings.json", optional: true);
                configApp.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
                configApp.AddEnvironmentVariables();
                configApp.AddApplicationInsightsSettings(developerMode: !env.IsProduction());
            })
            .ConfigureServices((hostContext, services) =>
            {
               [...]
            })
            .ConfigureContainer<ContainerBuilder>(builder =>
            {
                builder.RegisterModule<MessagerModule>();
            })
            .ConfigureLogging((hostContext, configLogging) =>
            {
                if (hostContext.HostingEnvironment.IsDevelopment())
                {
                    configLogging.AddConsole();
                    configLogging.AddDebug();
                }
            })
            .UseConsoleLifetime();

and here is the function:

[Function("QueueMessage")]
        public async Task QueueMessageAsync(
            [TimerTrigger("%MessageQueuerOccurence%", RunOnStartup = true)] TimerInfo timer
        )
        {
           [...]
        }

csproj:

<PropertyGroup>
        <TargetFramework>net6.0</TargetFramework>
        <AzureFunctionsVersion>v4</AzureFunctionsVersion>
        <OutputType>Exe</OutputType>
    </PropertyGroup>

    <ItemGroup>
        <Content Include="**\*.json" Exclude="bin\**\*;obj\**\*" CopyToOutputDirectory="Always" />
    </ItemGroup>
    
    <ItemGroup>
        <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.2.0" />
        <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.20.0" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.1.0" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage" Version="5.0.0" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.3.0" OutputItemType="Analyzer" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.6.0" />
        <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
        <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.0" />
    </ItemGroup>

local.settings.json:

{ "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "UseDevelopmentStorage=true", "MessageQueuerOccurence": "0 */15 * * * *", "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" } }

What did I miss?

note: link to Github : https://github.com/Azure/azure-functions-dotnet-worker/issues/779

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I was having this issue because I didn't have the storage emulator running...

It worked once I installed and ran azurite, which is the storage emulator that is being maintained (Azure storage explorer has been discontinued). You can find more information here on how to install it and use it.

I am using VS Code on a Mac OS, and I found the simplest solution to install azurite extension on VS Code. After the installation, I just had to edit the extension settings, in order to set the location setting (any folder should work). After that I was able to start azurite by running the Azurite: Start from the VS Code command palette.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda